home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 666 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  54 lines

  1. Path: news.staffs.ac.uk!bs47c!cm2bcmr
  2. From: cm2bcmr@bs47c.staffs.ac.uk (A  z  r  a  e  l)
  3. Newsgroups: comp.lang.c
  4. Subject: Q) GCC C PREPROCESSOR
  5. Date: 8 Jan 1996 10:14:27 GMT
  6. Organization: Staffordshire University
  7. Message-ID: <4cqqq3$6fc@bs33n.staffs.ac.uk>
  8. NNTP-Posting-Host: bs47c.staffs.ac.uk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi,
  12.  
  13. If you can answer the following gcc preprocessor question, please
  14. email:-
  15.  
  16. cm2bcmr@bs47c.staffs.ac.uk
  17.  
  18.  
  19. I am writing a C preprocessor as part of a university project. I am
  20. using the gcc compiler version 2.7.0 and Linux.
  21.  
  22. When the following file is preprocessed by gcc using the -E option:-
  23.  
  24. #include <stdio.h>
  25.  
  26. int main(void)
  27.    printf("HELLO, WORLD\n");
  28.    return (0); 
  29. }
  30.  
  31.  
  32. The following type of output is generated:-
  33.  
  34. # 1 "hello.c"
  35. # 1 "/usr/include/stdio.h" 1 3
  36. # 1 "/usr/include/features.h" 1 3
  37. # 1 "/usr/include/sys/cdefs.h" 1 3
  38. # 136 "/usr/include/features.h" 1 3
  39. # 24 "/usr/include/sys/cdefs.h" 2 3
  40. # 50 "/usr/include/sys/cdefs.h" 3
  41. # 100 "/usr/include/sys/cdefs.h" 3
  42. etc.
  43.  
  44. Question:-
  45.  
  46. The first # line is the name of the file being preprocessed. The other
  47. # lines represent the include files that are used by the program. What
  48. do the numbers in the # include lines represent? I believe that the
  49. compiler uses these numbers for error reporting...
  50.  
  51. Thanx,
  52.  
  53. Malcolm.
  54.